@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>业务管理</li>
            <li class="active">用户管理</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
          用户 &nbsp;&nbsp;{{ $user->userInfo->name }}&nbsp;&nbsp;---交易流水
        </div>
        <div class="row wrapper">
        	<!-- 1 start -->
        	<div class="col-sm-10">
                <form class="form-horizontal" method="get"
                      action="{{admin_action('Business\SalesStatisticsController@transactionRecord',['id'=>$user->id])}}">
                    <div class="row">
                        <div class="col-sm-10">
                            <div class="form-group">
                                <label class="control-label col-sm-2">交易时间:</label>
                                <div class="col-sm-4">
                                    
                                    <input type="text" class="form-control datetimepicker" name="startTime"
                                           value="{{ $query['startTime'] }}" placeholder="请选择开始时间">

                                </div>
                                <div class="col-sm-4">
                                    
                                    <input type="text" class="form-control datetimepicker" name="endTime"
                                           value="{{ $query['endTime'] }}" placeholder="请选择结束时间">

                                </div>
                            </div>
                        </div>
                        <div class="col-sm-1 text-left">
            <span class="input-group-btn">
              <button class="btn btn-sm btn-default" type="submit">查询</button>
            </span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="col-sm-2 text-right text-center-xs">

                <a class="btn btn-xs btn-primary"
                       href="{{ admin_action('Business\SalesStatisticsController@index') }}"
                       data-toggle="tooltip" title="投资记录">
                    <i class="fa fa-exchange"></i>
                </a>
                <a class="btn btn-xs btn-primary"
                       href="{{ admin_action('Business\SalesStatisticsController@brokerList') }}"
                       data-toggle="tooltip" title="经纪人管理">
                    <i class="fa fa-group"></i>
                </a>
                  <a class="btn btn-xs btn-primary"
                       href="{{ admin_action('Business\SalesStatisticsController@userList') }}"
                       data-toggle="tooltip" title="客户管理">
                    <i class="fa fa-user"></i>
                </a>
            </div>
        	<!-- 1 end -->
        </div>
        <div class="table-responsive">

           <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>交易流水号</th>
                    <th>交易类型</th>
                    <th>交易金额</th>
                    <th>交易时间</th>
                    <th>余额</th>
                    <th>交易状态</th>
                </tr>
                </thead>
                <tbody>
                @forelse ($data as $d)
                    <tr>
                    	<td>{{ $d->sn }}</td>
                    	<td>{{ $d->remarks??'--' }}</td>
                    	<td>{{ $d->money??'--' }}</td>
                    	<td>{{ $d->pay_time??'--' }}</td>
                    	<td>{{ $d->user_balance??'--' }}</td>
                    	<td>
                    		@if($d->status==1)
                    			成功
                			@elseif($d->status==0)
                				处理中
            				@elseif($d->status==-1)
            					失败
        					@else
        						状态未知
        					@endif

                    	</td>
                    </tr>
                @empty
                    <tr>
                        <td colspan="3" class="text-center">没有找到客户投资记录</td>
                    </tr>
                @endforelse
                </tbody>
            </table>

        </div>
        <div class="panel-footer">
            <div class="row">
                <div class="col-sm-12 text-right text-center-xs">
                	{!! $links !!}
                </div>
            </div>
        </div>
    </div>
@endsection
@section('scripts')
  <script src="{{ asset('resources/admin/plugins/echarts/echarts.min.js') }}"></script>
	<script type="text/javascript">
	</script>
@endsection